<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="${base}/script/jquery-2.0.3.min.js"></script>
<title>formData</title>
</head>
<body>
	<form id="fileForm">
		姓名：<input type="text" name="fileName"/><br>
		选择文件：<input type="file" id="file" name="uploadFile" /> 
		选择文件：<input type="file" id="file2" name="uploadFile2" /> 
		<input type="button" id="submitButton" value="提交" onclick="submitFile()" />
	</form>
	<script type="text/javascript">
	function submitFile() {
		var fd = new FormData(document.querySelector("#fileForm"));
		fd.append("CustomField", "This is some extra data");
		$.ajax({
		  url: "${base}/dataForm/dataFormAjax.do",
		  type: "POST",
		  data: fd,
		  processData: false,  // 不处理数据
		  contentType: false,   // 不设置内容类型
		  success:function(res) {
			  alert(res);
		  }
		});
		
	}
	</script>
</body>
</html>